#ifndef DOUBLELINKEDQUEUE_H
#define DOUBLELINKEDQUEUE_H

#include "stdio.h"
#include "stdlib.h"

typedef int ElemType;

typedef struct Node {
    ElemType data;
    struct Node* next;
    struct Node* prev;
} Node;

typedef struct DoubleLinkedQueue {
    Node* front;
    Node* rear;
} DoubleLinkedQueue;

DoubleLinkedQueue* init_queue();

Node* create_node(ElemType data);

int is_empty(DoubleLinkedQueue* queue);

int size(DoubleLinkedQueue* queue);

void enqueue_front(DoubleLinkedQueue* queue, ElemType data);

void enqueue_rear(DoubleLinkedQueue* queue, ElemType data);

ElemType dequeue_front(DoubleLinkedQueue* queue);

ElemType dequeue_rear(DoubleLinkedQueue* queue);

ElemType front(DoubleLinkedQueue* queue);

ElemType rear(DoubleLinkedQueue* queue);

void dequque_all_front(DoubleLinkedQueue* queue);

void dequque_all_rear(DoubleLinkedQueue* queue);

void clear_queue(DoubleLinkedQueue* queue);

// void print_queue_front(DoubleLinkedQueue* queue);

// void print_queue_rear(DoubleLinkedQueue* queue);

#endif  // DOUBLELINKEDQUEUE_H